import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:vape_xe/utils/utils.dart';
import 'package:vape_xe/widgets/widgets.dart';

import 'logic.dart';

class RewardsView extends GetView<RewardsController> {
  const RewardsView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: IconButton(
          icon: const Icon(Icons.arrow_back_ios_new_rounded),
          onPressed: () => {Navigator.of(context).pop('刷新')},
        ),
        title: Text('Rewards'.tr),
      ),
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          20.hGap,
          Padding(
            padding: EdgeInsets.only(left: 20.w),
            child: Text(
              'Rewards'.tr,
              style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.bold),
            ),
          ),
          16.hGap,
          Container(
            height: 75.h,
            margin: EdgeInsets.symmetric(horizontal: 16.w),
            padding: EdgeInsets.symmetric(horizontal: 16.w),
            decoration: BoxDecoration(
              borderRadius: 12.radius,
              color: Colors.white10,
            ),
            child: Row(
              children: [
                Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text('Join the Whatsapp Group'.tr, style: TextStyle(fontSize: 16.sp, fontWeight: FontWeight.bold)),
                    4.hGap,
                    Text('+20 experience points'.tr,
                        style: TextStyle(
                          fontSize: 11.sp,
                          foreground: Paint()
                            ..shader = const LinearGradient(
                              colors: <Color>[Color(0xffF5B946), Color(0xffF58546)],
                            ).createShader(
                              const Rect.fromLTWH(0.0, 0.0, 150.0, 0.0),
                            ),
                        ))
                  ],
                ),
                const Spacer(),
                Image.asset('assets/images/ic_tiaozhuan.webp', width: 28.w, height: 28.w),
              ],
            ),
          ),
          Container(
            height: 75.h,
            margin: EdgeInsets.only(left: 16.w, top: 12.w, right: 16.w),
            padding: EdgeInsets.symmetric(horizontal: 16.w),
            decoration: BoxDecoration(
              borderRadius: 12.radius,
              color: Colors.white10,
            ),
            child: Row(
              children: [
                Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text('Join the Telegram group'.tr, style: TextStyle(fontSize: 16.sp, fontWeight: FontWeight.bold)),
                    4.hGap,
                    Text('+20 experience points'.tr,
                        style: TextStyle(
                          fontSize: 11.sp,
                          foreground: Paint()
                            ..shader = const LinearGradient(
                              colors: <Color>[Color(0xffF5B946), Color(0xffF58546)],
                            ).createShader(
                              const Rect.fromLTWH(0.0, 0.0, 150.0, 0.0),
                            ),
                        ))
                  ],
                ),
                const Spacer(),
                Image.asset('assets/images/ic_tiaozhuan.webp', width: 28.w, height: 28.w),
              ],
            ),
          ),
          InkWell(
            onTap: () {
              Get.dialog(
                DialogView(message: 'Mission accomplished!'.tr),
                barrierDismissible: false,
              );
            },
            child: Container(
              height: 75.h,
              margin: EdgeInsets.only(left: 16.w, top: 12.w, right: 16.w),
              padding: EdgeInsets.symmetric(horizontal: 16.w),
              decoration: BoxDecoration(
                borderRadius: 12.radius,
                color: Colors.white10,
              ),
              child: Row(
                children: [
                  Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text('Follow us'.tr, style: TextStyle(fontSize: 16.sp, fontWeight: FontWeight.bold)),
                      4.hGap,
                      Text('+20 experience points'.tr,
                          style: TextStyle(
                            fontSize: 11.sp,
                            foreground: Paint()
                              ..shader = const LinearGradient(
                                colors: <Color>[Colors.white30, Colors.white30],
                                // colors: <Color>[Color(0xffF5B946), Color(0xffF58546)],
                              ).createShader(
                                const Rect.fromLTWH(0.0, 0.0, 150.0, 0.0),
                              ),
                          ))
                    ],
                  ),
                  const Spacer(),
                  Image.asset('assets/images/ic_chenggong.webp', width: 28.w, height: 28.w),
                ],
              ),
            ),
          )
        ],
      ),
    );
  }
}
